3.4.58 \(\int \sec ^2(c+d x) \sqrt {a+a \sec (c+d x)} (B \sec (c+d x)+C \sec ^2(c+d x)) \, dx\) [358]

3.4.58.1 Optimal result
3.4.58.2 Mathematica [A] (verified)
3.4.58.3 Rubi [A] (verified)
3.4.58.4 Maple [A] (verified)
3.4.58.5 Fricas [A] (verification not implemented)
3.4.58.6 Sympy [F]
3.4.58.7 Maxima [F]
3.4.58.8 Giac [F]
3.4.58.9 Mupad [B] (verification not implemented)

3.4.58.1 Optimal result

Integrand size = 42, antiderivative size = 144 \[ \int \sec ^2(c+d x) \sqrt {a+a \sec (c+d x)} \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {2 a (7 B+6 C) \tan (c+d x)}{15 d \sqrt {a+a \sec (c+d x)}}+\frac {2 a C \sec ^3(c+d x) \tan (c+d x)}{7 d \sqrt {a+a \sec (c+d x)}}-\frac {4 (7 B+6 C) \sqrt {a+a \sec (c+d x)} \tan (c+d x)}{105 d}+\frac {2 (7 B+6 C) (a+a \sec (c+d x))^{3/2} \tan (c+d x)}{35 a d} \]

output
2/35*(7*B+6*C)*(a+a*sec(d*x+c))^(3/2)*tan(d*x+c)/a/d+2/15*a*(7*B+6*C)*tan( 
d*x+c)/d/(a+a*sec(d*x+c))^(1/2)+2/7*a*C*sec(d*x+c)^3*tan(d*x+c)/d/(a+a*sec 
(d*x+c))^(1/2)-4/105*(7*B+6*C)*(a+a*sec(d*x+c))^(1/2)*tan(d*x+c)/d
 
3.4.58.2 Mathematica [A] (verified)

Time = 0.51 (sec) , antiderivative size = 81, normalized size of antiderivative = 0.56 \[ \int \sec ^2(c+d x) \sqrt {a+a \sec (c+d x)} \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {2 a \left (8 (7 B+6 C)+4 (7 B+6 C) \sec (c+d x)+3 (7 B+6 C) \sec ^2(c+d x)+15 C \sec ^3(c+d x)\right ) \tan (c+d x)}{105 d \sqrt {a (1+\sec (c+d x))}} \]

input
Integrate[Sec[c + d*x]^2*Sqrt[a + a*Sec[c + d*x]]*(B*Sec[c + d*x] + C*Sec[ 
c + d*x]^2),x]
 
output
(2*a*(8*(7*B + 6*C) + 4*(7*B + 6*C)*Sec[c + d*x] + 3*(7*B + 6*C)*Sec[c + d 
*x]^2 + 15*C*Sec[c + d*x]^3)*Tan[c + d*x])/(105*d*Sqrt[a*(1 + Sec[c + d*x] 
)])
 
3.4.58.3 Rubi [A] (verified)

Time = 0.90 (sec) , antiderivative size = 146, normalized size of antiderivative = 1.01, number of steps used = 11, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.262, Rules used = {3042, 4560, 3042, 4504, 3042, 4287, 27, 3042, 4489, 3042, 4279}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \sec ^2(c+d x) \sqrt {a \sec (c+d x)+a} \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \csc \left (c+d x+\frac {\pi }{2}\right )^2 \sqrt {a \csc \left (c+d x+\frac {\pi }{2}\right )+a} \left (B \csc \left (c+d x+\frac {\pi }{2}\right )+C \csc \left (c+d x+\frac {\pi }{2}\right )^2\right )dx\)

\(\Big \downarrow \) 4560

\(\displaystyle \int \sec ^3(c+d x) \sqrt {a \sec (c+d x)+a} (B+C \sec (c+d x))dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \csc \left (c+d x+\frac {\pi }{2}\right )^3 \sqrt {a \csc \left (c+d x+\frac {\pi }{2}\right )+a} \left (B+C \csc \left (c+d x+\frac {\pi }{2}\right )\right )dx\)

\(\Big \downarrow \) 4504

\(\displaystyle \frac {1}{7} (7 B+6 C) \int \sec ^3(c+d x) \sqrt {\sec (c+d x) a+a}dx+\frac {2 a C \tan (c+d x) \sec ^3(c+d x)}{7 d \sqrt {a \sec (c+d x)+a}}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{7} (7 B+6 C) \int \csc \left (c+d x+\frac {\pi }{2}\right )^3 \sqrt {\csc \left (c+d x+\frac {\pi }{2}\right ) a+a}dx+\frac {2 a C \tan (c+d x) \sec ^3(c+d x)}{7 d \sqrt {a \sec (c+d x)+a}}\)

\(\Big \downarrow \) 4287

\(\displaystyle \frac {1}{7} (7 B+6 C) \left (\frac {2 \int \frac {1}{2} \sec (c+d x) (3 a-2 a \sec (c+d x)) \sqrt {\sec (c+d x) a+a}dx}{5 a}+\frac {2 \tan (c+d x) (a \sec (c+d x)+a)^{3/2}}{5 a d}\right )+\frac {2 a C \tan (c+d x) \sec ^3(c+d x)}{7 d \sqrt {a \sec (c+d x)+a}}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {1}{7} (7 B+6 C) \left (\frac {\int \sec (c+d x) (3 a-2 a \sec (c+d x)) \sqrt {\sec (c+d x) a+a}dx}{5 a}+\frac {2 \tan (c+d x) (a \sec (c+d x)+a)^{3/2}}{5 a d}\right )+\frac {2 a C \tan (c+d x) \sec ^3(c+d x)}{7 d \sqrt {a \sec (c+d x)+a}}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{7} (7 B+6 C) \left (\frac {\int \csc \left (c+d x+\frac {\pi }{2}\right ) \left (3 a-2 a \csc \left (c+d x+\frac {\pi }{2}\right )\right ) \sqrt {\csc \left (c+d x+\frac {\pi }{2}\right ) a+a}dx}{5 a}+\frac {2 \tan (c+d x) (a \sec (c+d x)+a)^{3/2}}{5 a d}\right )+\frac {2 a C \tan (c+d x) \sec ^3(c+d x)}{7 d \sqrt {a \sec (c+d x)+a}}\)

\(\Big \downarrow \) 4489

\(\displaystyle \frac {1}{7} (7 B+6 C) \left (\frac {\frac {7}{3} a \int \sec (c+d x) \sqrt {\sec (c+d x) a+a}dx-\frac {4 a \tan (c+d x) \sqrt {a \sec (c+d x)+a}}{3 d}}{5 a}+\frac {2 \tan (c+d x) (a \sec (c+d x)+a)^{3/2}}{5 a d}\right )+\frac {2 a C \tan (c+d x) \sec ^3(c+d x)}{7 d \sqrt {a \sec (c+d x)+a}}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{7} (7 B+6 C) \left (\frac {\frac {7}{3} a \int \csc \left (c+d x+\frac {\pi }{2}\right ) \sqrt {\csc \left (c+d x+\frac {\pi }{2}\right ) a+a}dx-\frac {4 a \tan (c+d x) \sqrt {a \sec (c+d x)+a}}{3 d}}{5 a}+\frac {2 \tan (c+d x) (a \sec (c+d x)+a)^{3/2}}{5 a d}\right )+\frac {2 a C \tan (c+d x) \sec ^3(c+d x)}{7 d \sqrt {a \sec (c+d x)+a}}\)

\(\Big \downarrow \) 4279

\(\displaystyle \frac {1}{7} (7 B+6 C) \left (\frac {\frac {14 a^2 \tan (c+d x)}{3 d \sqrt {a \sec (c+d x)+a}}-\frac {4 a \tan (c+d x) \sqrt {a \sec (c+d x)+a}}{3 d}}{5 a}+\frac {2 \tan (c+d x) (a \sec (c+d x)+a)^{3/2}}{5 a d}\right )+\frac {2 a C \tan (c+d x) \sec ^3(c+d x)}{7 d \sqrt {a \sec (c+d x)+a}}\)

input
Int[Sec[c + d*x]^2*Sqrt[a + a*Sec[c + d*x]]*(B*Sec[c + d*x] + C*Sec[c + d* 
x]^2),x]
 
output
(2*a*C*Sec[c + d*x]^3*Tan[c + d*x])/(7*d*Sqrt[a + a*Sec[c + d*x]]) + ((7*B 
 + 6*C)*((2*(a + a*Sec[c + d*x])^(3/2)*Tan[c + d*x])/(5*a*d) + ((14*a^2*Ta 
n[c + d*x])/(3*d*Sqrt[a + a*Sec[c + d*x]]) - (4*a*Sqrt[a + a*Sec[c + d*x]] 
*Tan[c + d*x])/(3*d))/(5*a)))/7
 

3.4.58.3.1 Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4279
Int[csc[(e_.) + (f_.)*(x_)]*Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)], x_S 
ymbol] :> Simp[-2*b*(Cot[e + f*x]/(f*Sqrt[a + b*Csc[e + f*x]])), x] /; Free 
Q[{a, b, e, f}, x] && EqQ[a^2 - b^2, 0]
 

rule 4287
Int[csc[(e_.) + (f_.)*(x_)]^3*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_), 
x_Symbol] :> Simp[(-Cot[e + f*x])*((a + b*Csc[e + f*x])^(m + 1)/(b*f*(m + 2 
))), x] + Simp[1/(b*(m + 2))   Int[Csc[e + f*x]*(a + b*Csc[e + f*x])^m*(b*( 
m + 1) - a*Csc[e + f*x]), x], x] /; FreeQ[{a, b, e, f, m}, x] && EqQ[a^2 - 
b^2, 0] &&  !LtQ[m, -2^(-1)]
 

rule 4489
Int[csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(cs 
c[(e_.) + (f_.)*(x_)]*(B_.) + (A_)), x_Symbol] :> Simp[(-B)*Cot[e + f*x]*(( 
a + b*Csc[e + f*x])^m/(f*(m + 1))), x] + Simp[(a*B*m + A*b*(m + 1))/(b*(m + 
 1))   Int[Csc[e + f*x]*(a + b*Csc[e + f*x])^m, x], x] /; FreeQ[{a, b, A, B 
, e, f, m}, x] && NeQ[A*b - a*B, 0] && EqQ[a^2 - b^2, 0] && NeQ[a*B*m + A*b 
*(m + 1), 0] &&  !LtQ[m, -2^(-1)]
 

rule 4504
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) 
 + (a_)]*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)), x_Symbol] :> Simp[-2*b*B*C 
ot[e + f*x]*((d*Csc[e + f*x])^n/(f*(2*n + 1)*Sqrt[a + b*Csc[e + f*x]])), x] 
 + Simp[(A*b*(2*n + 1) + 2*a*B*n)/(b*(2*n + 1))   Int[Sqrt[a + b*Csc[e + f* 
x]]*(d*Csc[e + f*x])^n, x], x] /; FreeQ[{a, b, d, e, f, A, B, n}, x] && NeQ 
[A*b - a*B, 0] && EqQ[a^2 - b^2, 0] && NeQ[A*b*(2*n + 1) + 2*a*B*n, 0] && 
!LtQ[n, 0]
 

rule 4560
Int[((a_.) + csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*((A_.) + csc[(e_.) + (f_. 
)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.))*((c_.) + csc[(e_.) + (f_.) 
*(x_)]*(d_.))^(n_.), x_Symbol] :> Simp[1/b^2   Int[(a + b*Csc[e + f*x])^(m 
+ 1)*(c + d*Csc[e + f*x])^n*(b*B - a*C + b*C*Csc[e + f*x]), x], x] /; FreeQ 
[{a, b, c, d, e, f, A, B, C, m, n}, x] && EqQ[A*b^2 - a*b*B + a^2*C, 0]
 
3.4.58.4 Maple [A] (verified)

Time = 0.71 (sec) , antiderivative size = 108, normalized size of antiderivative = 0.75

method result size
default \(\frac {2 \left (56 B \cos \left (d x +c \right )^{3}+48 C \cos \left (d x +c \right )^{3}+28 B \cos \left (d x +c \right )^{2}+24 C \cos \left (d x +c \right )^{2}+21 B \cos \left (d x +c \right )+18 C \cos \left (d x +c \right )+15 C \right ) \sqrt {a \left (1+\sec \left (d x +c \right )\right )}\, \tan \left (d x +c \right ) \sec \left (d x +c \right )^{2}}{105 d \left (\cos \left (d x +c \right )+1\right )}\) \(108\)
parts \(\frac {2 B \sqrt {a \left (1+\sec \left (d x +c \right )\right )}\, \left (8 \sin \left (d x +c \right )+4 \tan \left (d x +c \right )+3 \sec \left (d x +c \right ) \tan \left (d x +c \right )\right )}{15 d \left (\cos \left (d x +c \right )+1\right )}+\frac {2 C \left (16 \cos \left (d x +c \right )^{3}+8 \cos \left (d x +c \right )^{2}+6 \cos \left (d x +c \right )+5\right ) \sqrt {a \left (1+\sec \left (d x +c \right )\right )}\, \tan \left (d x +c \right ) \sec \left (d x +c \right )^{2}}{35 d \left (\cos \left (d x +c \right )+1\right )}\) \(133\)

input
int(sec(d*x+c)^2*(B*sec(d*x+c)+C*sec(d*x+c)^2)*(a+a*sec(d*x+c))^(1/2),x,me 
thod=_RETURNVERBOSE)
 
output
2/105/d*(56*B*cos(d*x+c)^3+48*C*cos(d*x+c)^3+28*B*cos(d*x+c)^2+24*C*cos(d* 
x+c)^2+21*B*cos(d*x+c)+18*C*cos(d*x+c)+15*C)*(a*(1+sec(d*x+c)))^(1/2)/(cos 
(d*x+c)+1)*tan(d*x+c)*sec(d*x+c)^2
 
3.4.58.5 Fricas [A] (verification not implemented)

Time = 0.28 (sec) , antiderivative size = 105, normalized size of antiderivative = 0.73 \[ \int \sec ^2(c+d x) \sqrt {a+a \sec (c+d x)} \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {2 \, {\left (8 \, {\left (7 \, B + 6 \, C\right )} \cos \left (d x + c\right )^{3} + 4 \, {\left (7 \, B + 6 \, C\right )} \cos \left (d x + c\right )^{2} + 3 \, {\left (7 \, B + 6 \, C\right )} \cos \left (d x + c\right ) + 15 \, C\right )} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right )}{105 \, {\left (d \cos \left (d x + c\right )^{4} + d \cos \left (d x + c\right )^{3}\right )}} \]

input
integrate(sec(d*x+c)^2*(B*sec(d*x+c)+C*sec(d*x+c)^2)*(a+a*sec(d*x+c))^(1/2 
),x, algorithm="fricas")
 
output
2/105*(8*(7*B + 6*C)*cos(d*x + c)^3 + 4*(7*B + 6*C)*cos(d*x + c)^2 + 3*(7* 
B + 6*C)*cos(d*x + c) + 15*C)*sqrt((a*cos(d*x + c) + a)/cos(d*x + c))*sin( 
d*x + c)/(d*cos(d*x + c)^4 + d*cos(d*x + c)^3)
 
3.4.58.6 Sympy [F]

\[ \int \sec ^2(c+d x) \sqrt {a+a \sec (c+d x)} \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\int \sqrt {a \left (\sec {\left (c + d x \right )} + 1\right )} \left (B + C \sec {\left (c + d x \right )}\right ) \sec ^{3}{\left (c + d x \right )}\, dx \]

input
integrate(sec(d*x+c)**2*(B*sec(d*x+c)+C*sec(d*x+c)**2)*(a+a*sec(d*x+c))**( 
1/2),x)
 
output
Integral(sqrt(a*(sec(c + d*x) + 1))*(B + C*sec(c + d*x))*sec(c + d*x)**3, 
x)
 
3.4.58.7 Maxima [F]

\[ \int \sec ^2(c+d x) \sqrt {a+a \sec (c+d x)} \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\int { {\left (C \sec \left (d x + c\right )^{2} + B \sec \left (d x + c\right )\right )} \sqrt {a \sec \left (d x + c\right ) + a} \sec \left (d x + c\right )^{2} \,d x } \]

input
integrate(sec(d*x+c)^2*(B*sec(d*x+c)+C*sec(d*x+c)^2)*(a+a*sec(d*x+c))^(1/2 
),x, algorithm="maxima")
 
output
-8/105*((cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1) 
^(1/4)*(7*(5*B*sin(4*d*x + 4*c) + (7*B + 6*C)*sin(2*d*x + 2*c))*cos(7/2*ar 
ctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) - (35*B*cos(4*d*x + 4*c) + 
7*(7*B + 6*C)*cos(2*d*x + 2*c) + 14*B + 12*C)*sin(7/2*arctan2(sin(2*d*x + 
2*c), cos(2*d*x + 2*c) + 1)))*sqrt(a) - 105*(((B + 2*C)*d*cos(2*d*x + 2*c) 
^4 + (B + 2*C)*d*sin(2*d*x + 2*c)^4 + 4*(B + 2*C)*d*cos(2*d*x + 2*c)^3 + 6 
*(B + 2*C)*d*cos(2*d*x + 2*c)^2 + 4*(B + 2*C)*d*cos(2*d*x + 2*c) + 2*((B + 
 2*C)*d*cos(2*d*x + 2*c)^2 + 2*(B + 2*C)*d*cos(2*d*x + 2*c) + (B + 2*C)*d) 
*sin(2*d*x + 2*c)^2 + (B + 2*C)*d)*integrate((((cos(10*d*x + 10*c)*cos(2*d 
*x + 2*c) + 4*cos(8*d*x + 8*c)*cos(2*d*x + 2*c) + 6*cos(6*d*x + 6*c)*cos(2 
*d*x + 2*c) + 4*cos(4*d*x + 4*c)*cos(2*d*x + 2*c) + cos(2*d*x + 2*c)^2 + s 
in(10*d*x + 10*c)*sin(2*d*x + 2*c) + 4*sin(8*d*x + 8*c)*sin(2*d*x + 2*c) + 
 6*sin(6*d*x + 6*c)*sin(2*d*x + 2*c) + 4*sin(4*d*x + 4*c)*sin(2*d*x + 2*c) 
 + sin(2*d*x + 2*c)^2)*cos(5/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c)) 
) + (cos(2*d*x + 2*c)*sin(10*d*x + 10*c) + 4*cos(2*d*x + 2*c)*sin(8*d*x + 
8*c) + 6*cos(2*d*x + 2*c)*sin(6*d*x + 6*c) + 4*cos(2*d*x + 2*c)*sin(4*d*x 
+ 4*c) - cos(10*d*x + 10*c)*sin(2*d*x + 2*c) - 4*cos(8*d*x + 8*c)*sin(2*d* 
x + 2*c) - 6*cos(6*d*x + 6*c)*sin(2*d*x + 2*c) - 4*cos(4*d*x + 4*c)*sin(2* 
d*x + 2*c))*sin(5/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c))))*cos(1/2* 
arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) - ((cos(2*d*x + 2*c)*s...
 
3.4.58.8 Giac [F]

\[ \int \sec ^2(c+d x) \sqrt {a+a \sec (c+d x)} \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\int { {\left (C \sec \left (d x + c\right )^{2} + B \sec \left (d x + c\right )\right )} \sqrt {a \sec \left (d x + c\right ) + a} \sec \left (d x + c\right )^{2} \,d x } \]

input
integrate(sec(d*x+c)^2*(B*sec(d*x+c)+C*sec(d*x+c)^2)*(a+a*sec(d*x+c))^(1/2 
),x, algorithm="giac")
 
output
sage0*x
 
3.4.58.9 Mupad [B] (verification not implemented)

Time = 20.21 (sec) , antiderivative size = 407, normalized size of antiderivative = 2.83 \[ \int \sec ^2(c+d x) \sqrt {a+a \sec (c+d x)} \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {\sqrt {a+\frac {a}{\frac {{\mathrm {e}}^{-c\,1{}\mathrm {i}-d\,x\,1{}\mathrm {i}}}{2}+\frac {{\mathrm {e}}^{c\,1{}\mathrm {i}+d\,x\,1{}\mathrm {i}}}{2}}}\,\left (-\frac {B\,8{}\mathrm {i}}{5\,d}+\frac {C\,16{}\mathrm {i}}{5\,d}+{\mathrm {e}}^{c\,1{}\mathrm {i}+d\,x\,1{}\mathrm {i}}\,\left (\frac {C\,16{}\mathrm {i}}{35\,d}+\frac {\left (56\,B+112\,C\right )\,1{}\mathrm {i}}{35\,d}\right )\right )}{\left ({\mathrm {e}}^{c\,1{}\mathrm {i}+d\,x\,1{}\mathrm {i}}+1\right )\,{\left ({\mathrm {e}}^{c\,2{}\mathrm {i}+d\,x\,2{}\mathrm {i}}+1\right )}^2}+\frac {\sqrt {a+\frac {a}{\frac {{\mathrm {e}}^{-c\,1{}\mathrm {i}-d\,x\,1{}\mathrm {i}}}{2}+\frac {{\mathrm {e}}^{c\,1{}\mathrm {i}+d\,x\,1{}\mathrm {i}}}{2}}}\,\left (\frac {B\,8{}\mathrm {i}}{7\,d}+{\mathrm {e}}^{c\,1{}\mathrm {i}+d\,x\,1{}\mathrm {i}}\,\left (\frac {B\,8{}\mathrm {i}}{7\,d}-\frac {\left (8\,B+16\,C\right )\,1{}\mathrm {i}}{7\,d}\right )-\frac {\left (8\,B+16\,C\right )\,1{}\mathrm {i}}{7\,d}\right )}{\left ({\mathrm {e}}^{c\,1{}\mathrm {i}+d\,x\,1{}\mathrm {i}}+1\right )\,{\left ({\mathrm {e}}^{c\,2{}\mathrm {i}+d\,x\,2{}\mathrm {i}}+1\right )}^3}+\frac {\left (\frac {B\,8{}\mathrm {i}}{3\,d}-\frac {{\mathrm {e}}^{c\,1{}\mathrm {i}+d\,x\,1{}\mathrm {i}}\,\left (56\,B+48\,C\right )\,1{}\mathrm {i}}{105\,d}\right )\,\sqrt {a+\frac {a}{\frac {{\mathrm {e}}^{-c\,1{}\mathrm {i}-d\,x\,1{}\mathrm {i}}}{2}+\frac {{\mathrm {e}}^{c\,1{}\mathrm {i}+d\,x\,1{}\mathrm {i}}}{2}}}}{\left ({\mathrm {e}}^{c\,1{}\mathrm {i}+d\,x\,1{}\mathrm {i}}+1\right )\,\left ({\mathrm {e}}^{c\,2{}\mathrm {i}+d\,x\,2{}\mathrm {i}}+1\right )}-\frac {{\mathrm {e}}^{c\,1{}\mathrm {i}+d\,x\,1{}\mathrm {i}}\,\sqrt {a+\frac {a}{\frac {{\mathrm {e}}^{-c\,1{}\mathrm {i}-d\,x\,1{}\mathrm {i}}}{2}+\frac {{\mathrm {e}}^{c\,1{}\mathrm {i}+d\,x\,1{}\mathrm {i}}}{2}}}\,\left (112\,B+96\,C\right )\,1{}\mathrm {i}}{105\,d\,\left ({\mathrm {e}}^{c\,1{}\mathrm {i}+d\,x\,1{}\mathrm {i}}+1\right )} \]

input
int(((B/cos(c + d*x) + C/cos(c + d*x)^2)*(a + a/cos(c + d*x))^(1/2))/cos(c 
 + d*x)^2,x)
 
output
((a + a/(exp(- c*1i - d*x*1i)/2 + exp(c*1i + d*x*1i)/2))^(1/2)*((C*16i)/(5 
*d) - (B*8i)/(5*d) + exp(c*1i + d*x*1i)*((C*16i)/(35*d) + ((56*B + 112*C)* 
1i)/(35*d))))/((exp(c*1i + d*x*1i) + 1)*(exp(c*2i + d*x*2i) + 1)^2) + ((a 
+ a/(exp(- c*1i - d*x*1i)/2 + exp(c*1i + d*x*1i)/2))^(1/2)*((B*8i)/(7*d) + 
 exp(c*1i + d*x*1i)*((B*8i)/(7*d) - ((8*B + 16*C)*1i)/(7*d)) - ((8*B + 16* 
C)*1i)/(7*d)))/((exp(c*1i + d*x*1i) + 1)*(exp(c*2i + d*x*2i) + 1)^3) + ((( 
B*8i)/(3*d) - (exp(c*1i + d*x*1i)*(56*B + 48*C)*1i)/(105*d))*(a + a/(exp(- 
 c*1i - d*x*1i)/2 + exp(c*1i + d*x*1i)/2))^(1/2))/((exp(c*1i + d*x*1i) + 1 
)*(exp(c*2i + d*x*2i) + 1)) - (exp(c*1i + d*x*1i)*(a + a/(exp(- c*1i - d*x 
*1i)/2 + exp(c*1i + d*x*1i)/2))^(1/2)*(112*B + 96*C)*1i)/(105*d*(exp(c*1i 
+ d*x*1i) + 1))